﻿using BaseSimpleAPI;
using CommonHelper;
using System;
using System.Collections.Generic;
using System.Threading;
using UDPHelper;
using System.IO;

namespace AMInstantMessagingService
{
    class Program
    {
        static void Main(string[] args)
        {
            //UDPServer udpserver = new UDPServer();
            UDPServer udpserver = SingleCase.Single<UDPServer>();
            SingleCase.RegisterSingle<IBaseServer>(udpserver);

            Console.WriteLine("Start Listening " + udpserver.Port);

            udpserver.RouteData.Formats = new List<string> { "{Controller}/{Action}" };

            udpserver.LoadAllController();
            udpserver.Start();

            while (udpserver.IsRuning)
                Thread.Sleep(1000);

            udpserver.Stop();
        }
    }
}
